Loading and Invoking JavaServer Servlets

JavaServer

Loading and Invoking Servlets


Documentation / Developer Docs / Administrator Docs / Index / Features

Loading Servlets

Servlets can be loaded from three places:
  1. From a directory that is on the CLASSPATH. The CLASSPATH of the JavaWebServer includes service_root/classes/ which is where the system classes reside.
  2. From the /servlets/ directory. This is *not* in the server's classpath. A classloader is used to create servlets from this directory. New servlets can be added - existing servlets can be recompiled and the server will notice these changes.
  3. From a remote location. For this a codebase like http://nine.eng/classes/foo/ is required in addition to the servlet's class name. Refer to the admin GUI docs on servlet section to see how to set this up.

For information on how to load servlets using the Administration Tool, see Servlet Loading.

Loading Remote Servlets

Remote servlets can be loaded by:

  1. configuring the Admin Tool to setup automatic loading of remote servlets
  2. setting up server side include tags in .shtml files
  3. defining a filter chain configuration
NOTE: Remote servlets can have security mplications. For more information, see Servlet Sandbox.

Identifying Servlets

Servlets are identified by <servletName> which is either:

Invoking Servlets

A servlet invoker is a servlet that invokes the "service" method on a named servlet. If the servlet is not loaded in the server, then the invoker first loads the servlet (either from local disk or from the network) and the then invokes the "service" method. Also like applets, local servlets in the server can be identified by just the class name. In other words, if a servlet name is not absolute, it is treated as local.

Servlets can be invoked by a client in the following ways:

NOTE: <servletName>> is any valid servlet identifier as described in the previous section.
Top
java-server-feedback@java.sun.com